package com.xtpt.disaster.bean;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.stereotype.Component;

import java.io.Serializable;
import java.util.Date;

@Component
public class JobDetail implements Serializable{
    @ApiModelProperty(value = "作业id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long jobId;

    @ApiModelProperty(value = "作业名称")
    private String jobName;

    @ApiModelProperty(value = "作业描述")
    private String jobDesc;

    @ApiModelProperty(value = "数据类型")
    private Integer dataType;

    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "任务ID")
    private Long taskId;

    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "节点ID")
    private Long nodeId;

    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "数据库ID")
    private Long dbId;

    @ApiModelProperty(value = "节点ip")
    private String nodeIp;

    @ApiModelProperty(value = "作业开始时间")
    private Date jobStartTime;

    @ApiModelProperty(value = "作业结束时间")
    private Date jobEndTime;

    @ApiModelProperty(value = "作业类型，备份0还是恢复1")
    private Integer jobType;

    @ApiModelProperty(value = "备份类型，全量0还是增量1")
    private Integer jobBackupType;

    @ApiModelProperty(value = "作业状态，成功0还是失败-1")
    private Integer jobStatus;

    @ApiModelProperty(value = "所备份的数据库的类型，0-MYSQL 1-ORACLE 2-SQLSERVER 3-达梦 4-金仓  5-神通")
    private Integer sourceDbType;

    @ApiModelProperty(value = "文件在备份服务器上存储的路径，master节点的存储绝对路径，多文件以,分隔")
    private String serverPath;

    @ApiModelProperty(value = "原文件的存储路径，代理端备份节点文件存储绝对路径，多文件以,分隔")
    private String clientPath;

    @ApiModelProperty(value = "调度的类型， (\"立刻执行任务\", 0),   (\"在指定时间执行一次\", 1),    (\"日、周、月、年周期性执行\", 2),   (\"根据Corn表达式执行\", 3);")
    private Integer scheduleType;

    @ApiModelProperty(value = "作业命令记录")
    private String jobCommand;

    @ApiModelProperty(value = "作业结果记录")
    private String jobResult;

    @ApiModelProperty(value = "文件类型  0-文件，1-文件夹")
    private Integer fileType;

    public String getNodeIp() {
        return nodeIp;
    }

    public void setNodeIp(String nodeIp) {
        this.nodeIp = nodeIp;
    }

    public Integer getJobBackupType() {
        return jobBackupType;
    }

    public void setJobBackupType(Integer jobBackupType) {
        this.jobBackupType = jobBackupType;
    }

    public Long getDbId() {
        return dbId;
    }

    public String getJobDesc() {
        return jobDesc;
    }

    public void setJobDesc(String jobDesc) {
        this.jobDesc = jobDesc;
    }

    public void setDbId(Long dbId) {
        this.dbId = dbId;
    }

    public String getJobCommand() {
        return jobCommand;
    }

    public void setJobCommand(String jobCommand) {
        this.jobCommand = jobCommand;
    }

    public String getJobResult() {
        return jobResult;
    }

    public void setJobResult(String jobResult) {
        this.jobResult = jobResult;
    }

    public Long getJobId() {
        return jobId;
    }

    public void setJobId(Long jobId) {
        this.jobId = jobId;
    }

    public String getJobName() {
        return jobName;
    }

    public void setJobName(String jobName) {
        this.jobName = jobName == null ? null : jobName.trim();
    }

    public Integer getDataType() {
        return dataType;
    }

    public void setDataType(Integer dataType) {
        this.dataType = dataType;
    }

    public Long getTaskId() {
        return taskId;
    }

    public void setTaskId(Long taskId) {
        this.taskId = taskId;
    }

    public Long getNodeId() {
        return nodeId;
    }

    public void setNodeId(Long nodeId) {
        this.nodeId = nodeId;
    }

    public Date getJobStartTime() {
        return jobStartTime;
    }

    public void setJobStartTime(Date jobStartTime) {
        this.jobStartTime = jobStartTime;
    }

    public Date getJobEndTime() {
        return jobEndTime;
    }

    public void setJobEndTime(Date jobEndTime) {
        this.jobEndTime = jobEndTime;
    }

    public Integer getJobType() {
        return jobType;
    }

    public void setJobType(Integer jobType) {
        this.jobType = jobType;
    }

    public Integer getJobStatus() {
        return jobStatus;
    }

    public void setJobStatus(Integer jobStatus) {
        this.jobStatus = jobStatus;
    }

    public Integer getSourceDbType() {
        return sourceDbType;
    }

    public void setSourceDbType(Integer sourceDbType) {
        this.sourceDbType = sourceDbType;
    }

    public String getServerPath() {
        return serverPath;
    }

    public void setServerPath(String serverPath) {
        this.serverPath = serverPath == null ? null : serverPath.trim();
    }

    public String getClientPath() {
        return clientPath;
    }

    public void setClientPath(String clientPath) {
        this.clientPath = clientPath == null ? null : clientPath.trim();
    }

    public Integer getScheduleType() {
        return scheduleType;
    }

    public void setScheduleType(Integer scheduleType) {
        this.scheduleType = scheduleType;
    }

    public Integer getFileType() {
        return fileType;
    }

    public void setFileType(Integer fileType) {
        this.fileType = fileType;
    }
}